	<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>元宝管理系统登录</title>
<load href='__PUBLIC__/Css/style.css' />
<load href="__PUBLIC__/Js/Base.js" />
<load href="__PUBLIC__/Js/mootools-1.2.4-core.js" />
<load href="__PUBLIC__/Js/common.js" />
<script type="text/javascript" src="__PUBLIC__/Js/Utils/md5-min.js"></script> 
 <script language="JavaScript">
window.addEvent('domready', function() {
    if((Cookie.read('keepLogin')=='true'))
	{	//alert('Cookie keepLogin Value is: '+Cookie.read('keepLogin'));
		;$('chk').checked = true;
		$('user_id').value = Cookie.read('user_id');
		$('password').value = Cookie.read('password');
		$('user_id').readonly = true;
		$('password').readonly = true;		
		
		var myRequest = new Request.JSON({
		method: 'post', 
		url: '__URL__/_ajaxLogin/',
		data: 'userid='+Cookie.read('user_id')+'&password='+Cookie.read('password'),
		headers: 'Content-Type:text/html; charset=utf-8',
		onSuccess: function(data){
			Loperate(data);
		},
		onFailure: function(){
			$('result').set('text', '请求失败.');
				}	
		}).send();
		
	}
	});

	function Loperate(data)
	{
		if(data[0]['status']=='ok')
		{
		window.location.href='http://yuanbao';		
		}
	}


	function keydown(e){
		var e = e || event;
		if (e.keyCode==13)
		{
		$('submit').click();
		}
	}
	
	function fleshVerify(type){ 
		var timenow = new Date().getTime();
		if (type)
		{
		$('verifyImg').src= '__URL__/verify/adv/1/'+timenow;
		}else{
		$('verifyImg').src= '__URL__/verify/'+timenow;
		}
	
	}

	function goRegUrl(){

		 window.location.href='__URL__/regUser';	
	}
	
	function chkRem(id){
		if(($(id).checked == true))
		{
		$('checked').value = 'true';
		}	
		else
		{
		$('checked').value = 'false';
		}
	}

</script>
</head>
<body onLoad="document.login.user_id.focus()" >
<form method='post' name="login" id="form1" action="__URL__/checkLogin" >
<div class="tCenter hMargin">
<table id="checkList" class="login shadow" cellpadding=0 cellspacing=0 >
<tr><td height="5" colspan="2" class="topTd" ></td></tr>
<tr class="row" >
  <Th colspan="2" class="tCenter space" ><img src="__PUBLIC__/Images/logo.png" width="36" height="32" border="0" alt="" align="absmiddle"> 系统登录</th>
</tr>
<tr><td height="5" colspan="2" class="topTd" ></td></tr>
<tr class="row" ><td colspan="2" class="tCenter"><div id="result" class="result none"></div></td></tr>
<tr class="row" ><td class="tRight" width="25%">帐 号：</td><td><input type="text" class="medium bLeftRequire" check="Require" warning="请输入帐号" id="user_id" name="user_id"></td></tr>
<tr class="row" ><td class="tRight">密 码：</td><td><input id="password" type="password"  class="medium bLeftRequire" check="Require" onblur="if((this.value).length<16){this.value=hex_md5(this.value);}"   warning="请输入密码" name="password"></td></tr>
<tr class="row" ><td class="tRight">验证码：</td><td><input type="text" onKeyDown="keydown(event)"  class="small bLeftRequire" check="Require" warning="请输入验证码" name="verify"> <img id="verifyImg" SRC="__URL__/verify/" onClick="fleshVerify()" BORDER="0" ALT="点击刷新验证码" style="cursor:pointer" align="absmiddle"></td></tr>
<tr><td align="center"><input type="checkbox" id="chk" name="chk" onclick="chkRem(this.id);" />
<input type="text" style="display:none" name="checked" id="checked" value="false" /></td><td>记住登陆状态</td></tr>
<tr class="row" ><td class="tCenter" align="justify" colspan="2">
<input type="submit" value="登 录" id="submit"  class="submit medium hMargin"> 
<input name="submit" type="button" onclick="goRegUrl()" class="submit medium hMargin" id="regbtn" value="注 册" /></td>
</tr>
<tr><td height="5" colspan="2" class="bottomTd" ></td></tr>
</table>
<div id="rest" class="result">系统需要登陆后使用</div>
</div>
</form>
</body>
</html>